 <?php  echo $this->session->flash(); 
	if(!empty($unitGrpMainData)){
	      $this->Paginator->options(array(
	         'update' => '#divUpdate',
	         'evalScripts' => true, 
	      ));

	} ?>
<div class="file" id="List">
       <table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#686550">
        <tr class="heading"  bgcolor="#708089">
	      <td width="6%" valign="top" align="left"><?php  __('S.NO')?></td>
          
	      <td valign="top" width="30%" align="left"><?php echo $this->Paginator->sort('group_name', __('GROUP_NAME',true)); ?></td>
	      <td valign="top" width="30%" align ="left"><?php echo $this->Paginator->sort('created', __('CREATED',true)); ?></td>
		 
	      <td valign="top" width="20%" align="left"><?php  echo __('ACTION');?></td>
        </tr>
	<?php
        if(isset($unitGrpMainData) && count($unitGrpMainData)>0){
          $i=0;
          foreach($unitGrpMainData as $arrayDetail){
          ?>
            <tr class="heading2" bgcolor="#ffffff">
		    <td>&nbsp;<?php echo $i+1?></td>
		    
		     <td>&nbsp;<?php echo $arrayDetail['ServiceGroup']['group_name']?></td>
		     <td>&nbsp;<?php echo date('M j, Y', strtotime($arrayDetail['ServiceGroup']['created']));?></td>
		     <td>
			    <?php
			    if(!$roleId){//No checks for superadmin
				   echo $this->html->link($this->Html->image('icons/16/edit_icon.png', array('escape' => FALSE)), array('controller'=>'servicegroups', 'action' => 'edit', $arrayDetail['ServiceGroup']['id']), array('alt'=> __('EDIT',true),'title'=> __('EDIT',true), 'escape' => false));
                                   echo $this->html->link($this->Html->image('icons/16/icon_view.gif', array('escape' => FALSE)), array('controller'=>'servicegroups', 'action' => 'view', $arrayDetail['ServiceGroup']['id']), array('alt'=> __('LIST',true),'title'=> __('LIST',true), 'escape' => false));
			    }else{
				   if($showServiceGroupEditURL){
				       echo $this->html->link($this->Html->image('icons/16/edit_icon.png', array('escape' => FALSE)), array('controller'=>'servicegroups', 'action' => 'edit', $arrayDetail['ServiceGroup']['id']), array('alt'=> __('EDIT',true),'title'=> __('EDIT',true), 'escape' => false));
                                   echo $this->html->link($this->Html->image('icons/16/icon_view.gif', array('escape' => FALSE)), array('controller'=>'servicegroups', 'action' => 'view', $arrayDetail['ServiceGroup']['id']), array('alt'=> __('LIST',true),'title'=> __('LIST',true), 'escape' => false));
				   }
			    }
			    
			    ?>
		     </td>
              </tr>  
          <?php
          $i++;
          }
        }
        ?>
	<tr><td colspan="5" bgcolor="#ffffff" align="center"><div class="pagination">            
	      <?php		     
	      if(!empty($unitGrpMainData)){
		     
		     echo $this->Element('pagination');
		     
	      } else{
		     echo __("NO_RECORD_MESSAGE");
	      }
              ?>              
          </div></td></tr>
	
	<tr bgcolor="#ffffff">
	    <td colspan="5" valign="top">
	       <table width="25%">
		  <tr>
		     <td width="10%">
			<b><?php echo __('LEGENDS')?> :- </b> 
		     </td>
		     <td width="10%">
			<?php echo $this->html->image('/img/icons/16/edit_icon.png');?>

			<?php echo __('EDIT')?>
		     </td>
		     <td width="10%">
			<?php echo $this->html->image('/img/icons/16/icon_view.gif');?>

			<?php echo __('VIEW')?>
		     </td>
		      
		  </tr>
		</table>
	    </td>
	 </tr>
       </table>
</div>
<?php echo $this->Js->writeBuffer();?>